package com.board.controller;


import com.board.dto.FoodDto;
import com.board.service.FoodService;
import com.board.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小叶
 * @since 2024年04月08日
 */
@RestController
@RequestMapping("/food")
public class FoodController {
    @Autowired
    private FoodService foodService;

    //根据ids查询菜品信息
    @PostMapping("/findFoodByIds")
    public Result<List<FoodDto>> findFoodByIds(@RequestBody List<Integer> foodIds){
        List<FoodDto> foodDtoList = foodService.findFoodByIds(foodIds);
        return Result.success("查询成功",foodDtoList);
    }


}

